// 组织架构接口层
import request from '@/utils/request'

/**
 * @description:查询企业的部门列表
 * @param {type}get
 * @return:
 */
export function getDepartments() {
  return request({
    url: '/company/department'
  })
}

/**
 * @description:新增子部门
 * @param {type}post
 * @return:
 */
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

/**
 * @description:根据ID查询部门详情
 * @param {type}get
 * @return:
 */
export function getDepartmentsDetail(id) {
  return request({
    url: `/company/department/${id}`
  })
}

/**
 * @description:根据ID修改部门详情
 * @param {type} put
 * @return:
 */
export function editDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
/**
 * @description:根据ID删除部门
 * @param {type} put
 * @return:
 */
export function deleteDepartments(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}
